<?php
namespace Hawk\Model;
use Think\Model;
use Think\Model\RelationModel; 
class CommunicateLogModel extends RelationModel 
{
	protected $insertFields = array('cus_id','content','status','type');
	protected $updateFields = array('id','cus_id','content','status','type');
	protected $_validate = array(
		array('content', 'require', '备注不能为空！', 1, 'regex', 3),
		array('type', 'require', '请选择记录类型！', 1, 'regex', 3)
		);
	public function _before_insert(&$data, $option){
		$data['user_id'] = session('id');
		$data['addtime']=time();
		$data['updatetime']=time();
	}
	public function _before_update(&$data, $option){
		$data['user_id'] = session('id');
		$data['updatetime']=time();
	}
}